package com.vsked.util;

public class JstlProcess {
	public static String getC(){
		return Symbol.enterSymbol+""+Symbol.enterSymbol;
	}
	
	/**
	 * @return <c:out value="@param inValue"/> 
	 */
	public static String getCout(String inValue){
		return Symbol.enterSymbol+"<c:out value=\""+inValue+"\"/>"+Symbol.enterSymbol;
	}
	/**
	 * @return <c:set var="@param inVar" value="@param inValue" scope="@param inScope" />
	 */
	public static String getCset(String inVar,String inValue,String inScope){
		return Symbol.enterSymbol+"<c:set var=\""+inVar+"\" value=\""+inValue+"\"  scope=\""+inScope+"\" />"+Symbol.enterSymbol;
	}
	/**
	 * @return <c:set target="@param inTarget" property="@param inProperty" value="@param inValue"/>
	 */
	public static String getCsetTarget(String inTarget,String inProperty,String inValue){
		return Symbol.enterSymbol+"<c:set target=\""+inTarget+"\" property=\""+inProperty+"\"  value=\""+inValue+"\" />"+Symbol.enterSymbol;
	}
	/**
	 * @param inScope包括page、request、session、application等
	 * @return <c:remove var="@param inVar" scope="@param inScope"/> 
	 */
	public static String getCremove(String inVar,String inScope){
		return Symbol.enterSymbol+"<c:remove var=\""+inVar+"\" scope=\""+inScope+"\" />"+Symbol.enterSymbol;
	}
	
	/**
	 * <c:forTokens items="@param inItems" delims="@param inDelims" var="@param inVar">
     *@param inContent
     *</c:forTokens>
	 * @return
	 */
	public static String getCfortokens(String inItems,String inDelims,String inVar,String inContent){
		return Symbol.enterSymbol+"<c:forTokens items=\""+inItems+"\" delims=\""+inDelims+"\" var=\""+inVar+"\">"+inContent+Symbol.enterSymbol+"</c:forTokens>"+Symbol.enterSymbol;
	}
	/**
	 * <c:forEach begin="@param inBegin" end="@param inEnd" var="@param inVar" step="@param inStep">
     *@param inCforeachContent
     *</c:forEach>
	 * @return
	 */
	public static String getCforeach(String inBegin,String inEnd,String inVar,String inStep,String inCforeachContent){
		return Symbol.enterSymbol+"<c:forEach begin=\""+inBegin+"\" end=\""+inEnd+"\" var=\""+inVar+"\" step=\""+inStep+"\">"+inCforeachContent+Symbol.enterSymbol+"</c:forEach>";
	}
	/**
	 *<c:forEach items="@param inElList" var="@param inVname" varStatus="status">
     *@param inCforeachContent
     *</c:forEach>
	 * @return
	 */
	public static String getCforeach(String inElList,String inVname,String inCforeachContent){
		return Symbol.enterSymbol+"<c:forEach items=\""+inElList+"\" var=\""+inVname+"\" varStatus=\"status\">"+inCforeachContent+Symbol.enterSymbol+"</c:forEach>"+Symbol.enterSymbol;
	}
	public static String getCif(String inIfExpress,String inTrueValue){
		return Symbol.enterSymbol+"<c:if test=\""+inIfExpress+"\">"+inTrueValue+"</c:if>"+Symbol.enterSymbol;
	}
	public static String getCparam(String inName,String inValue){
		return Symbol.enterSymbol+"<c:param name=\""+inName+"\" value=\""+inValue+"\"/>"+Symbol.enterSymbol;
	}
	public static String getCimport(String inUrl){
		return "<c:import url=\""+inUrl+"\" charEncoding=\"utf-8\" />";
	}
	public static String getCimport(String inUrl,String inCharEncoding){
		return "<c:import url=\""+inUrl+"\" charEncoding=\""+inCharEncoding+"\"  />";
	}
	public static String getCredirect(String inUrl){
		return Symbol.enterSymbol+"<c:redirect url=\""+inUrl+"\"></c:redirect>"+Symbol.enterSymbol;
	}
	public static String getCredirect(String inUrl,String inParam){
		return Symbol.enterSymbol+"<c:redirect url=\""+inUrl+"\">"+inParam+"</c:redirect>"+Symbol.enterSymbol;
	}
	
	
	public static String getElExpressValue(String inElExpressValues){
		return "${"+inElExpressValues+"}";
	}
	public static String getElExpressValueForRequestParameter(String inParameter){
		return "${param."+inParameter+"==null?\"\":param."+inParameter+" }";
	}
	public static String getElExpressValueForSessionAttribute(String inParameter){
		return "${sessionScope."+inParameter+"==null?\"\":sessionScope."+inParameter+"}";
	}
	public static String getRemoveSessionAttribute(String inAttribute){
		return "session.removeAttribute(\""+inAttribute+"\");";
	}
	

}
